/*
 * Title: 得分（Score）
 * Author: Yuanshun L
 * Created: 29-Sep-2021
 */
#include<stdio.h>
#include<string.h>
#define MAXN 81
int score[MAXN];

int main() {
    char ch;
    int i=0,sum=0;
    memset(score,0,sizeof(score));
    // 填充成绩序列
    while((ch=getchar()) == 'O' || ch == 'X' ){
        if(i==0){
            if(ch=='O')
                score[i]=1;
            else
                score[i]=0;

        }
        else{
            if(ch=='O')
                score[i] = score[i-1]+1;
            else
                score[i]=0;
        }
        i++;
    }
    for(int k=0;k<i;k++){
        sum+=score[k];
    }
    printf("%d",sum);
    return 0;
}
